#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
string s,t;
int n,m,l[N],r[N];
namespace sub1{
	vector<int> vis[N],pre[N];
	int ans[N],cnt;
	inline void main()
	{
		for(int i = 1;i<=n;i++) vis[i].resize(m+1),pre[i].resize(m+1);
		queue<pair<int,int>> q;
//		for(int i = 1;i<=n;i++) cout<<l[i]<<' '<<r[i]<<'\n';
		if(s[1]==t[1])
		{
			for(int i = 1;i<=n;i++)
				if(s[i]!=s[1]) break;
				else q.push({i,1}),vis[i][1] = 1;
		}
		else for(int i = 1;i<=n;i++)
			if(s[i]==t[1])
			{
				q.push({i,1}),vis[i][1] = 1;
				break;
			}
		while(!q.empty())
		{
			int u = q.front().first,id = q.front().second;
			q.pop();
//			cout<<u<<' '<<id<<'\n';
			if(id==m) continue;
			int p = u+1;
			if(p<=n&&s[p]==t[id+1]&&!vis[p][id+1]) vis[p][id+1] = 1,pre[p][id+1] = u,q.push({p,id+1});
			p = r[u]+1;
			if(p<=n&&s[p]==t[id+1]&&!vis[p][id+1]) vis[p][id+1] = 1,pre[p][id+1] = u,q.push({p,id+1});
			if(u<r[u])
			{
				p = r[u];
				if(p<=n&&s[p]==t[id+1]&&!vis[p][id+1]) vis[p][id+1] = 1,pre[p][id+1] = u,q.push({p,id+1});
			}
			else
			{
				p = r[r[u]+1];
				if(p<=n&&s[p]==t[id+1]&&!vis[p][id+1]) vis[p][id+1] = 1,pre[p][id+1] = u,q.push({p,id+1});
				p = r[r[u]+1]+1;
				if(p<=n&&s[p]==t[id+1]&&!vis[p][id+1]) vis[p][id+1] = 1,pre[p][id+1] = u,q.push({p,id+1});
			}
		}
		for(int i = n;i;i--)
		{
			if(vis[i][m])
			{
				cout<<"YES\n";
				int p = i,now = m;
				while(p)
				{
					ans[++cnt] = p;
					p = pre[p][now],now--;
				}
				while(cnt) cout<<ans[cnt]<<' ',cnt--;
				return;
			}
			if(s[i]!=s[n]) break; 
		}
		cout<<"NO";
	}
}
namespace sub2{
	inline void work(int x)
	{
		vector<int> vec;
		if(x==r[x])
		{
			int p = x,tmp = m;
			while(p<=n&&tmp)
			{
				vec.push_back(p);
				p = r[r[p]+1];
				tmp--;
			}
			if(tmp==0&&vec.back()>=l[n]-1)
			{
				cout<<"YES\n";
				for(auto i:vec) cout<<i<<' ';
				exit(0);
			}
		}
		vec.clear();
		int p = x,tmp = m;
		while(p<=n&&tmp)
		{
			vec.push_back(p);
			p = r[p]+1;
			tmp--;
		}
		if(tmp==0&&vec.back()>=l[n]-1)
		{
			cout<<"YES\n";
			for(auto i:vec) cout<<i<<' ';
			exit(0);
		}
	}
	inline void main()
	{
		if(s[1]==t[1]) work(r[1]);
		else for(int i = 1;i<=n;i++)
			if(s[i]==t[1])
			{
				work(i);
				break;
			}
		cout<<"NO";
	}
}
signed main()
{
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>s>>t;
	n = s.size(),m = t.size();
	s = ' '+s,t = ' '+t;
	for(int i = 1;i<=n;i++)
		if(s[i]==s[i-1]) l[i] = l[i-1];
		else
		{
			l[i] = i;
			for(int j = l[i-1];j<i;j++) r[j] = i-1;
		}
	for(int j = l[n];j<=n;j++) r[j] = n;
	if(n*m<=1e7) sub1::main();
	else sub2::main();
	return 0;
}

